package com.knife.changerecord.api.controller.v1;

import com.knife.changerecord.app.service.ChangeRecordTxHeaderService;
import com.knife.changerecord.domain.ChangeRecordTxHeader;
import com.knife.common.utils.Results;
import com.knife.oauth.tenant.annonations.KnifeTenant;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 预算信息
 *
 * @author： 76875
 * @date： 2022/7/9 星期六 9:48
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@RestController("v1.ChangeRecordTxHeaderController")
@RequestMapping("/v1/{organizationId}/change-record")
@KnifeTenant
public class ChangeRecordTxHeaderController {

    @Resource
    private ChangeRecordTxHeaderService changeRecordTxHeaderService;

    @GetMapping("/module-detail")
    public ResponseEntity<List<ChangeRecordTxHeader>> selectChangeRecord(@PathVariable Long organizationId, @RequestParam String moduleType, @RequestParam Long moduleId) {
        return Results.success(changeRecordTxHeaderService.selectChangeRecord(organizationId, moduleType, moduleId));
    }
}
